{% include 'QLGL/QLGL_index.html' %}

<div class="am-cf admin-main">
  {% include 'sidebar.html' %}
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">字典数据</strong></div>
      </div>
      <div class="am-g" style="position: absolute;height: 100%;right: 0px;left: 260px;width: auto;">

        {% include 'QLGL/ZDSJ/QLGL_ZDSJ_SIDEBAR.html' %}
        
        <div class="am-u-sm-10" style="position: absolute;width:auto;right:0;left: 200px;height:85%;overflow-y: scroll;">

          <table id="grid_BHYS" class="am-table am-table-striped am-table-hover table-main am-table-compact am-text-nowrap" >
            <thead>
              <tr>
                <th class="table-title">病害名称</th>
                <th class="table-title">序号</th>
                <th class="table-title">状态</th>
                <th class="table-title">操作</th>
              </tr>
            </thead>
            <tbody></tbody>
          </table>

        </div>
      </div>
    </div>
  </div>
</div>
{% include 'footer.html' %}
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/static/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/static/assets/js/amazeui.min.js"></script>
<script src="/static/assets/js/amazeui.tree.js"></script>
<script type="text/javascript" src="/static/assets/js/layer.js"></script>
<script src="/static/assets/datatables/amazeui.datatables.min.js"></script>
<script src="/static/assets/dialog/amazeui.dialog.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/css/amazeui.tree.css" />
<script src="/static/assets/js/app.js"></script>
<style type="text/css">
  .li_a {
    color: #5c5c5c;
  }
</style>
<script type="text/javascript">
  $("#collapse-nav1").addClass("am-in");
  $("#qlgl").removeClass("am-collapsed");
  $("#qlglOzdsj").css("color", "#3399CC");
  $("#qlgl").css("color", "#3399CC");
  $("#zdsjObhys").removeClass("li_a");


var t = $('#grid_BHYS').DataTable({
  //配置DataTables默认参数



    bInfo: true,//页脚信息
    responsive: true,
    searching: true,
    lengthChange: false,
    paging: true,
    bStateSave: true, //保存页面状态
    aLengthMenu: [[10], [10]],
    order:[[1,"asc"]],
    ajax: {

      url: "/QLXJ_YSGL_BHLB/"
    },


    
    //每页显示五条数据
    //pageLength: 'all',
    columns: [
    /*
      {  
        data : null,  
        bSortable : false,  
        targets : 0,  
        //width : "30px",  
        render : function(data, type, row, meta) {  
          // 显示行号  
          var startIndex = meta.settings._iDisplayStart;  
          return startIndex + meta.row + 1;  
        }  
      },
    */
      {
        "data": "disease_name"
      },
      {
        "data": "orderby"
      },
      {
        "data": null,
        "render": function(data, type, row, meta) {
          return "有效"        
        }
      },
      {
        "data": "orderby"
      }
    ],
    "columnDefs": [
      // "visible": false,
      //"targets": 0
      {
        type: 'chinese-string',
        targets: '_all'
      } //中文排序
      ,      
      {
        "render": function(data, type, row, meta) {
          return '<div class="am-btn-toolbar"><div class="am-btn-group am-btn-group-xs"><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHBJ_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 部件</button><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHCL_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 材料</button><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHQX_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 桥型</button><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHZZ_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 支座</button><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHSX_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 属性</button><button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="BHCS_modify(' + row.disease_id + ',\'' + row.disease_name + '\')"><span class="am-icon-pencil-square-o"></span> 参数四</button></div></div>'        
        },
        //指定是第二列
        "targets": 3
      }
    ],
    

  });

  function BHBJ_modify(disease_id,disease_name){
    popup1(""+disease_name+" - 部件映射","/QLXJ_YSGL_BHBJ/?disease_id="+disease_id+"")
  }
  function BHCL_modify(disease_id,disease_name){
    popup1(""+disease_name+" - 材料映射","/QLXJ_YSGL_BHCL/?disease_id="+disease_id+"")
  }
  function BHQX_modify(disease_id,disease_name){
    popup2(""+disease_name+" - 桥型映射","/QLXJ_YSGL_BHQX/?disease_id="+disease_id+"")
  }
  function BHZZ_modify(disease_id,disease_name){
    popup2(""+disease_name+" - 支座映射","/QLXJ_YSGL_BHZZ/?disease_id="+disease_id+"")
  }
  function BHSX_modify(disease_id,disease_name){
    popup3(""+disease_name+" - 病害映射","/QLXJ_YSGL_BHSS/?disease_id="+disease_id+"")
  }
  function BHCS_modify(disease_id,disease_name){
    popup1(""+disease_name+" - 病害映射","/QLXJ_YSGL_BHCS4/?disease_id="+disease_id+"")
  }


  function popup1(title,url){
        var index = layer.open({
            type: 2,
            title: title,
            content: url,
            area: ['600px', '60%'],     
        }); 
  }
  function popup2(title,url){
        var index = layer.open({
            type: 2,
            title: title,
            content: url,
            area: ['600px', '320px'],     
        }); 
  }
  function popup3(title,url){
        var index = layer.open({
            type: 2,
            title: title,
            content: url,
            area: ['600px', '420px'],     
        }); 
  }
  var AlertMSG=function(msg){
    AMUI.dialog.alert({ title: '错误提示', content: msg, onConfirm: function() { console.log('close'); } });
  }

</script>
 
</body>

</html>